<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网易云音乐年终总结h5</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.2/css/swiper.min.css">
    <link rel="stylesheet" href="./common.css">
</head>
<body>
    <audio id="j-bgm" src="./bgm.mp3"></audio>
    <div class="next-view-c"></div>
    <div class="music-btn off"></div>
    <!-- 滑页操作 -->
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
                <div class="view index">
                    <div class="logo-c"></div>
                </div>
            </div>
            <div class="swiper-slide"></div>
            <div class="swiper-slide"></div>
            <div class="swiper-slide"></div>
            <div class="swiper-slide"></div>
        </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.2/js/swiper.min.js"></script>
    <script>
        const audio = document.getElementById('j-bgm');
        const musicBtn = document.querySelector('.music-btn');
        // let isMusicPause = true;
        musicBtn.addEventListener('click',function () {
            // if(isMusicPause) {
            //     audio.play();
            //     isMusicPause = false;
            // }else {
            //     audio.pause();
            //     isMusicPause = true;
            // }
            if (audio.paused) {
                audio.play();
            } else {
                audio.pause();
            }
            musicBtn.classList.toggle('off');
        })

        // 滑屏
        new Swiper('.swiper-container',{
            direction: 'vertical'
        })
    </script>
</body>
</html>